home *** CD-ROM | disk | FTP | other *** search
/ Apple WWDC 1996 / WWDC96_1996 (CD).toast / Technology Materials / MacOS 8 Resources / Developer Tools / Mac OS 8 Interfaces & Libraries / Interfaces / AIncludes / PCCardTuples.a < prev    next >
Text File  |  1996-05-01  |  15KB  |  352 lines

  1. ;
  2. ;    File:        PCCardTuples.a
  3. ;
  4. ;    Contains:    List of PCMCIA tuple types and definitions of tuple contents.
  5. ;
  6. ;    Version:    Technology:    System 7.5
  7. ;                Release:    Universal Interfaces 3.0d3 on Copland DR1
  8. ;
  9. ;    Copyright:    © 1984-1996 by Apple Computer, Inc.  All rights reserved.
  10. ;
  11. ;    Bugs?:        If you find a problem with this file, send the file and version
  12. ;                information (from above) and the problem description to:
  13. ;
  14. ;                    Internet:    apple.bugs@applelink.apple.com
  15. ;                    AppleLink:    APPLE.BUGS
  16. ;
  17. ;
  18.     IF &TYPE('__PCCARDTUPLES__') = 'UNDEFINED' THEN
  19. __PCCARDTUPLES__ SET 1
  20.  
  21.     IF &TYPE('__TYPES__') = 'UNDEFINED' THEN
  22.     include 'Types.a'
  23.     ENDIF
  24.  
  25. MAX_TUPLE_SIZE                    EQU        256
  26. ;
  27. ;------------------------------------------------------------------------------------------------------------------------------------------------
  28. ;    Defines for Tuple codes
  29. ;------------------------------------------------------------------------------------------------------------------------------------------------
  30. ;
  31.  
  32. CISTPL_NULL                        EQU        $00
  33. CISTPL_DEVICE                    EQU        $01
  34. CISTPL_LONGLINK_MFC                EQU        $06
  35. CISTPL_CHECKSUM                    EQU        $10
  36. CISTPL_LONGLINK_A                EQU        $11
  37. CISTPL_LONGLINK_C                EQU        $12
  38. CISTPL_LINKTARGET                EQU        $13
  39. CISTPL_NO_LINK                    EQU        $14
  40. CISTPL_VERS_1                    EQU        $15
  41. CISTPL_ALTSTR                    EQU        $16
  42. CISTPL_DEVICE_A                    EQU        $17
  43. CISTPL_JEDEC_C                    EQU        $18
  44. CISTPL_JEDEC_A                    EQU        $19
  45. CISTPL_CONFIG                    EQU        $1A
  46. CISTPL_CFTABLE_ENTRY            EQU        $1B
  47. CISTPL_DEVICE_OC                EQU        $1C
  48. CISTPL_DEVICE_OA                EQU        $1D
  49. CISTPL_DEVICE_GEO                EQU        $1E
  50. CISTPL_DEVICE_GEO_A                EQU        $1F
  51. CISTPL_MANFID                    EQU        $20
  52. CISTPL_FUNCID                    EQU        $21
  53. CISTPL_FUNCE                    EQU        $22
  54. CISTPL_SWIL                        EQU        $23
  55. CISTPL_VERS_2                    EQU        $40
  56. CISTPL_FORMAT                    EQU        $41
  57. CISTPL_GEOMETRY                    EQU        $42
  58. CISTPL_BYTEORDER                EQU        $43
  59. CISTPL_DATE                        EQU        $44
  60. CISTPL_BATTERY                    EQU        $45
  61. CISTPL_ORG                        EQU        $46
  62. CISTPL_VENDOR                    EQU        $FE
  63. CISTPL_END                        EQU        $FF
  64. ;
  65. ;------------------------------------------------------------------------------------------------------------------------------------------------
  66. ;    Tuple Data Block Definitions
  67. ;------------------------------------------------------------------------------------------------------------------------------------------------
  68. ;
  69. ; ------------    Device Information Tuple (01H, 17H)    -----------                            
  70. DeviceIDTuple            RECORD 0
  71. TPLDEV_TYPE_WPS_SPEED     ds.b    1                ; offset: $0 (0)        ;  Device Type Code: 7-4, WPS: 3,  Device Speed: 2-0
  72. deviceData                 ds.b    253                ; offset: $1 (1)
  73. sizeof                     EQU *                    ; size:   $FE (254)
  74.                         ENDR
  75.  
  76. TPLDEV_TYPE_MASK                EQU        $F0                    ; device type mask for TPLDEV_TYPE_WPS_SPEED
  77. TPLDEV_TYPE_EXTENDED            EQU        $E0                    ; device type value for extended type
  78. TPLDEV_WPS_MASK                    EQU        $08                    ; write-protect switch mask for TPLDEV_TYPE_WPS_SPEED
  79. TPLDEV_SPEED_MASK                EQU        $07                    ; device speed mask for TPLDEV_TYPE_WPS_SPEED
  80. TPLDEV_DSPEED_NULL                EQU        $00                    ; speed for null device type
  81. TPLDEV_DSPEED_250NS                EQU        $01                    ; 250ns card access time
  82. TPLDEV_DSPEED_200NS                EQU        $02                    ; 200ns card access time
  83. TPLDEV_DSPEED_150NS                EQU        $03                    ; 150ns card access time
  84. TPLDEV_DSPEED_100NS                EQU        $04                    ; 100ns card access time
  85. TPLDEV_EXTENDED_SPEED            EQU        $07                    ; device speed value for extended speed
  86. TPLDEV_SPEED_EXPONENT            EQU        $07                    ; extended byte exponent mask
  87. TPLDEV_SPEED_MANTISSA            EQU        $78                    ; extended byte mantissa mask
  88. TPLDEV_SPEED_EXTENDED_MASK        EQU        $80                    ; bit set if more extended speed data follows
  89. ;     device ID types
  90.  
  91. DTYPE_NULL                        EQU        0
  92. DTYPE_ROM                        EQU        1
  93. DTYPE_OTPROM                    EQU        2
  94. DTYPE_EPROM                        EQU        3
  95. DTYPE_EEPROM                    EQU        4
  96. DTYPE_FLASH                        EQU        5
  97. DTYPE_SRAM                        EQU        6
  98. DTYPE_DRAM                        EQU        7
  99. DTYPE_FUNCSPEC                    EQU        $0D
  100. DTYPE_EXTEND                    EQU        $0E
  101. ; ---------------    Checksum Control Tuple (10H)    ---------------                            
  102. ChecksumControlTuple    RECORD 0
  103. TPLCKS_ADDR                 ds.w    1                ; offset: $0 (0)        ;  offset to region to be checksummed, LSB first
  104. TPLCKS_LEN                 ds.w    1                ; offset: $2 (2)        ;  length of region to be checksummed, LSB first
  105. TPLCKS_CS                 ds.b    1                ; offset: $4 (4)        ;  checksum of the region
  106. reserved                 ds.b    1                ; offset: $5 (5)        ;  padding
  107. sizeof                     EQU *                    ; size:   $6 (6)
  108.                         ENDR
  109. ; ----------------    Long Link Multi-Function Tuple (06H)    ------                    
  110. LongLinkMFCTuple        RECORD 0
  111. TPLMFC_NUM                 ds.b    1                ; offset: $0 (0)        ;  Number of sets of config registers for individual functions
  112. TPLMFC_TAS1                 ds.b    1                ; offset: $1 (1)        ;  CIS target address space for first function (00 = Attr, 01 = Common)
  113. TPLMFC_ADDR1             ds.l    1                ; offset: $2 (2)        ;  Target address of first CIS, unsigned long, lsb first
  114. TPLMFC_TAS2                 ds.b    1                ; offset: $6 (6)        ;  CIS target address space for second function (00 = Attr, 01 = Common)
  115.                          ORG 8
  116. TPLMFC_ADDR2             ds.b    4                ; offset: $8 (8)        ;  [MISALIGNED!] Target address of second CIS, unsigned long, lsb first
  117. ;  the following fields are of undetermined length and should be calculated at runtime
  118. ;  
  119. ;  UInt8        TPLMFC_TASn;
  120. ;  UInt32        TPLMFC_ADDRn;
  121. sizeof                     EQU *                    ; size:   $C (12)
  122.                         ENDR
  123. ; ----------------    Long Link Tuple (11H, 12H)    ----------------                            
  124. LongLinkTuple            RECORD 0
  125. TPLL_ADDR                 ds.l    1                ; offset: $0 (0)        ;  target address, LSB first
  126. sizeof                     EQU *                    ; size:   $4 (4)
  127.                         ENDR
  128. ; -----------------    Link Target Tuple (13H)    ------------------                            
  129. LinkTargetTuple            RECORD 0
  130. TPLL_TAG                 ds.b    3                ; offset: $0 (0)        ;  tag: should be 'C', 'I', 'S'
  131.                          ORG 4
  132. sizeof                     EQU *                    ; size:   $4 (4)
  133.                         ENDR
  134. ; ----------------    Level 1 Version Tuple (15H)    ---------------                            
  135. Level1VersionTuple        RECORD 0
  136. TPLLV1_MAJOR             ds.b    1                ; offset: $0 (0)        ;  major version number (0x04)
  137. TPLLV1_MINOR             ds.b    1                ; offset: $1 (1)        ;  minor version number (0x01 for release 2.0 and 2.01)
  138. TPLLV1_INFO                 ds.b    1                ; offset: $2 (2) <-- really an array of length one ;  product information string, zero-terminated
  139.                          ORG 4
  140. sizeof                     EQU *                    ; size:   $4 (4)
  141.                         ENDR
  142. ; -------------    JEDEC Identifier Tuple (18H, 19H)    ------------                            
  143. JEDECDeviceInfo            RECORD 0
  144. manufacturerID             ds.b    1                ; offset: $0 (0)
  145. manufacturerInfo         ds.b    1                ; offset: $1 (1)
  146. sizeof                     EQU *                    ; size:   $2 (2)
  147.                         ENDR
  148. JEDECIdentifierTuple    RECORD 0
  149. device                     ds        JEDECDeviceInfo ; offset: $0 (0) <-- really an array of length one
  150. sizeof                     EQU *                    ; size:   $2 (2)
  151.                         ENDR
  152. ; ---------    Configuration Tuple (1AH)    ----------                            
  153. ConfigTuple                RECORD 0
  154. TPCC_SZ                     ds.b    1                ; offset: $0 (0)        ;  size of fields byte
  155. TPCC_LAST                 ds.b    1                ; offset: $1 (1)        ;  index number of last config entry
  156. TPCC_RADR                 ds.b    1                ; offset: $2 (2)        ;  config reg's base addr in reg. space
  157. reserved                 ds.b    1                ; offset: $3 (3)        ;  padding
  158. ;  the following fields are of undetermined length and should be calculated at runtime
  159. ; UInt32            TPCC_RMSK;
  160. ; UInt32            TPCC_RSVD;
  161. ; UInt32            TPCC_SBTPL;
  162. sizeof                     EQU *                    ; size:   $4 (4)
  163.                         ENDR
  164. ;     TPCC_RADR field definitions
  165.  
  166. TPCC_RASZ                        EQU        $03                    ; bits 1-0
  167. TPCC_RMSZ                        EQU        $3C                    ; bits 5-2
  168. TPCC_RFSZ                        EQU        $C0                    ; bits 7-6
  169. ; ---------    Device Geometry Tuple (1EH, 1FH)    ----------
  170. DeviceGeometry            RECORD 0
  171. DGTPL_BUS                 ds.b    1                ; offset: $0 (0)        ;  system bus width = 2^(n-1), n>0
  172. DGTPL_EBS                 ds.b    1                ; offset: $1 (1)        ;  erase block size = 2^(n-1), n>0
  173. DGTPL_RBS                 ds.b    1                ; offset: $2 (2)        ;  read block size = 2^(n-1), n>0
  174. DGTPL_WBS                 ds.b    1                ; offset: $3 (3)        ;  write block size = 2^(n-1), n>0
  175. DGTPL_PART                 ds.b    1                ; offset: $4 (4)        ;  partitioning size = 2^(n-1), n>0
  176. DGTPL_HWIL                 ds.b    1                ; offset: $5 (5)        ;  hardware interleave = 2^(n-1), n>0
  177. sizeof                     EQU *                    ; size:   $6 (6)
  178.                         ENDR
  179. DeviceGeometryTuple        RECORD 0
  180. device                     ds.b    42 * DeviceGeometry.sizeof ; offset: $0 (0)
  181. sizeof                     EQU *                    ; size:   $FC (252)
  182.                         ENDR
  183. ; ---------    Manufacturer Identification Tuple (20H)    ----------                            
  184. ManufIDTuple            RECORD 0
  185. TPLMID_MANF                 ds.w    1                ; offset: $0 (0)        ;  PCMCIA PC Card manufacturer code
  186. TPLMID_CARD                 ds.w    1                ; offset: $2 (2)        ;  manufacturer information (part number and/or revision)
  187. sizeof                     EQU *                    ; size:   $4 (4)
  188.                         ENDR
  189. ; -----------    Function Identification Tuple (21H)    ------------                            
  190. FunctionIDTuple            RECORD 0
  191. TPLFID_FUNCTION             ds.b    1                ; offset: $0 (0)        ;  PC card function code
  192. TPLFID_SYSINIT             ds.b    1                ; offset: $1 (1)        ;  system initialization bit mask
  193. sizeof                     EQU *                    ; size:   $2 (2)
  194.                         ENDR
  195. ;     function codes
  196.  
  197. TPLFID_MultiFunction            EQU        0
  198. TPLFID_Memory                    EQU        1
  199. TPLFID_SerialPort                EQU        2
  200. TPLFID_ParallelPort                EQU        3
  201. TPLFID_FixedDisk                EQU        4
  202. TPLFID_VideoAdaptor                EQU        5
  203. TPLFID_NetworkLANAdaptor        EQU        6
  204. TPLFID_AIMS                        EQU        7
  205. ; ------------    Software Interleave Tuple (23H)    ---------------                            
  206. SoftwareInterleaveTuple    RECORD 0
  207. TPLSWIL_INTRLV             ds.b    1                ; offset: $0 (0)        ;  software interleave
  208.                          ORG 2
  209. sizeof                     EQU *                    ; size:   $2 (2)
  210.                         ENDR
  211. ; -------    Level 2 Version and Information Tuple (40H)    --------                            
  212. Level2VersionTuple        RECORD 0
  213. TPLLV2_VERS                 ds.b    1                ; offset: $0 (0)        ;  structure version (0x00)
  214. TPLLV2_COMPLY             ds.b    1                ; offset: $1 (1)        ;  level of compliance with the standard (0x00)
  215. TPLLV2_DINDEX             ds.w    1                ; offset: $2 (2)        ;  byte address of first data byte in card, LSB first
  216. TPLLV2_RSV6                 ds.b    1                ; offset: $4 (4)        ;  reserved, must be zero
  217. TPLLV2_RSV7                 ds.b    1                ; offset: $5 (5)        ;  reserved, must be zero
  218. TPLLV2_VSPEC8             ds.b    1                ; offset: $6 (6)        ;  vendor specific byte
  219. TPLLV2_VSPEC9             ds.b    1                ; offset: $7 (7)        ;  vendor specific byte
  220. TPLLV2_NHDR                 ds.b    1                ; offset: $8 (8)        ;  number of copies of CIS present on this device
  221. TPLLV2_OEM                 ds.b    1                ; offset: $9 (9) <-- really an array of length one ;  vendor of software that formatted card, zero-terminated
  222. TPLLV2_INFO                 ds.b    1                ; offset: $A (10) <-- really an array of length one ;  informational message about the card, zero-terminated
  223. reserved                 ds.b    1                ; offset: $B (11)        ;  padding
  224. sizeof                     EQU *                    ; size:   $C (12)
  225.                         ENDR
  226. ;
  227. ;--------------------    Format Tuple (41H)    --------------------                            
  228. ; additional information for disk type:
  229. ;
  230. FormatDiskTuple            RECORD 0
  231. TPLFMT_BKSZ                 ds.w    1                ; offset: $0 (0)        ;     block size, or zero if unblocked format
  232. TPLFMT_NBLOCKS             ds.l    1                ; offset: $2 (2)        ;     number of data blocks in this partition
  233. TPLFMT_EDCLOC             ds.l    1                ; offset: $6 (6)        ;     location of error detection code, or zero if interleaved
  234. sizeof                     EQU *                    ; size:   $A (10)
  235.                         ENDR
  236. ;  additional information for disk type:
  237. FormatMemTuple            RECORD 0
  238. TPLFMT_FLAGS             ds.b    1                ; offset: $0 (0)        ;     various flags
  239. TPLFMT_RESERVED             ds.b    1                ; offset: $1 (1)        ;     reserved, set to zero
  240. TPLFMT_ADDRESS             ds.l    1                ; offset: $2 (2)        ;     physical location at which this memory partion must be mapped
  241. TPLFMT_EDCLOC             ds.l    1                ; offset: $6 (6)        ;     location of error detection code, or zero if interleaved
  242. sizeof                     EQU *                    ; size:   $A (10)
  243.                         ENDR
  244. FormatTuple                RECORD 0
  245. TPLFMT_TYPE                 ds.b    1                ; offset: $0 (0)        ;  format type code
  246. TPLFMT_EDC                 ds.b    1                ; offset: $1 (1)        ;  error detection method and length of error detection code
  247. TPLFMT_OFFSET             ds.l    1                ; offset: $2 (2)        ;  offset to first data byte in this partition
  248. TPLFMT_NBYTES             ds.l    1                ; offset: $6 (6)        ;  number of data bytes in this partition
  249. TPLFMT_DISK                 ds        FormatDiskTuple ; offset: $A (10)
  250.                          ORG 10
  251. TPLFMT_MEM                 ds        FormatMemTuple ; offset: $A (10)
  252. sizeof                     EQU *                    ; size:   $14 (20)
  253.                         ENDR
  254. ;     format types
  255.  
  256. TPLFMTTYPE_DISK                    EQU        0
  257. TPLFMTTYPE_MEM                    EQU        1
  258. TPLFMTTYPE_VS                    EQU        $80
  259. ;     error detection types
  260.  
  261. TPLFMTEDC_NONE                    EQU        0
  262. TPLFMTEDC_CKSUM                    EQU        1
  263. TPLFMTEDC_CRC                    EQU        2
  264. TPLFMTEDC_PCC                    EQU        3
  265. TPLFMTEDC_VS                    EQU        8
  266. ;     bits in TPLFMT_FLAGS
  267.  
  268. TPLFMTFLAGS_ADDR                EQU        0
  269. TPLFMTFLAGS_AUTO                EQU        1
  270. ; ------------------    Geometry Tuple (42H)    --------------------                            
  271. GeometryTuple            RECORD 0
  272. TPLGEO_SPT                 ds.b    1                ; offset: $0 (0)        ;  number of sectors per track
  273. TPLGEO_TPC                 ds.b    1                ; offset: $1 (1)        ;  number of tracks per cylinder
  274. TPLGEO_NCYL                 ds.w    1                ; offset: $2 (2)        ;  number of cylinders, total
  275. sizeof                     EQU *                    ; size:   $4 (4)
  276.                         ENDR
  277. ; -----------------    Byte-Order Tuple (43H)    -------------------                            
  278. ByteOrderTuple            RECORD 0
  279. TPLBYTE_ORDER             ds.b    1                ; offset: $0 (0)        ;  byte order code
  280. TPLBYTE_MAP                 ds.b    1                ; offset: $1 (1)        ;  byte mapping code
  281. sizeof                     EQU *                    ; size:   $2 (2)
  282.                         ENDR
  283. ;     byte order codes
  284.  
  285. TYPBYTEORD_LOW                    EQU        0
  286. TYPBYTEORD_HIGH                    EQU        1
  287. TYPBYTEORD_VS                    EQU        $80
  288. ;     byte mapping codes
  289.  
  290. TYPBYTEMAP_LOW                    EQU        0
  291. TYPBYTEMAP_HIGH                    EQU        1
  292. TYPBYTEMAP_VS                    EQU        $80
  293. ; ----------    Card Initialization Date Tuple (44H)    ------------                            
  294. CardInitDateTuple        RECORD 0
  295. TPLDATE_TIME             ds.w    1                ; offset: $0 (0)        ;  hours, minutes, seconds
  296. TPLDATE_DAY                 ds.w    1                ; offset: $2 (2)        ;  year, month, day
  297. sizeof                     EQU *                    ; size:   $4 (4)
  298.                         ENDR
  299. ; ----------    Battery-Replacement Date Tuple (45H)    ------------                            
  300. BatteryReplaceDateTuple    RECORD 0
  301. TPLBATT_RDAY             ds.w    1                ; offset: $0 (0)        ;  last replacement date (year, month, day)
  302. TPLBATT_XDAY             ds.w    1                ; offset: $2 (2)        ;  battery expiration date (year, month, day)
  303. sizeof                     EQU *                    ; size:   $4 (4)
  304.                         ENDR
  305. ; ----------------------    General Tuple    -----------------------                            
  306. TupleBody                RECORD 0
  307. deviceID                 ds        DeviceIDTuple    ; offset: $0 (0)
  308.                          ORG 0
  309. checksum                 ds        ChecksumControlTuple ; offset: $0 (0)
  310.                          ORG 0
  311. link                     ds        LongLinkTuple    ; offset: $0 (0)
  312.                          ORG 0
  313. target                     ds        LinkTargetTuple ; offset: $0 (0)
  314.                          ORG 0
  315. level1                     ds        Level1VersionTuple ; offset: $0 (0)
  316.                          ORG 0
  317. jedecID                     ds        JEDECIdentifierTuple ; offset: $0 (0)
  318.                          ORG 0
  319. config                     ds        ConfigTuple        ; offset: $0 (0)
  320.                          ORG 0
  321. devGeo                     ds        DeviceGeometryTuple ; offset: $0 (0)
  322.                          ORG 0
  323. manufID                     ds        ManufIDTuple    ; offset: $0 (0)
  324.                          ORG 0
  325. funcID                     ds        FunctionIDTuple ; offset: $0 (0)
  326.                          ORG 0
  327. swil                     ds        SoftwareInterleaveTuple ; offset: $0 (0)
  328.                          ORG 0
  329. level2                     ds        Level2VersionTuple ; offset: $0 (0)
  330.                          ORG 0
  331. format                     ds        FormatTuple        ; offset: $0 (0)
  332.                          ORG 0
  333. geometry                 ds        GeometryTuple    ; offset: $0 (0)
  334.                          ORG 0
  335. order                     ds        ByteOrderTuple ; offset: $0 (0)
  336.                          ORG 0
  337. initDate                 ds        CardInitDateTuple ; offset: $0 (0)
  338.                          ORG 0
  339. battDate                 ds        BatteryReplaceDateTuple ; offset: $0 (0)
  340.                          ORG 0
  341. tupleData                 ds.b    254                ; offset: $0 (0)
  342. sizeof                     EQU *                    ; size:   $FE (254)
  343.                         ENDR
  344. Tuple                    RECORD 0
  345. TPL_CODE                 ds.b    1                ; offset: $0 (0)
  346. TPL_LINK                 ds.b    1                ; offset: $1 (1)
  347. TPL_BODY                 ds        TupleBody        ; offset: $2 (2)
  348. sizeof                     EQU *                    ; size:   $100 (256)
  349.                         ENDR
  350.     ENDIF ; __PCCARDTUPLES__ 
  351.  
  352.